1. Field of the Invention
The present invention relates to a data processing device, a data processing method, and a computer program product.
2. Description of the Related Art
An image processing device such as a printer device temporarily stores image data in a memory. In this case, if the image data is stored in the memory as it is, a large-capacity memory is required, resulting in high cost. To address this, the image data is conventionally compressed and stored in the memory.
A print processing procedure in a conventional image processing device is performed as follows, for example. That is, an image formation device analyzes data in page descript language (PDL) received from a network and generates data in an intermediate language that is executable by a drawing device, and then the drawing device analyzes the data in the intermediate language to draw an image in a band memory. To draw an image in the band memory, the image formation device codes the image according to an image compression algorithm, stores the code in the memory, then at the time of printing, reads the coded data from the band memory with delays corresponding to cyan (C), magenta (M), yellow (Y), and black (K) plates, decodes the coded data according to the compression algorithm, transfers the decoded data corresponding to the C, M, Y, and K plates to a printer engine to print.
As a method for efficiently compressing data, Japanese Patent No. 4000266 describes a data coding method in which small dynamic dictionary is controlled according to a Move-To-Front (MTF) method, thereby executing an MTF control with a small dictionary and subjecting index values according to match with the dictionary, to run-length encoding.
With this method, however, a small number of words are registered in the dictionaries. Thus, for example, when the data width of a dictionary used for coding is 1 byte (=8 bits) and the depth of the dictionary is 64=26 pieces, only conversion of 8 bytes into 6 bytes is achieved even if target data matches the dictionary. Accordingly, the number of words in the dictionary needs to be increased. However, in this case, the match becomes hard to occur using the dictionary.
Therefore, in the data coding method described in Japanese Patent No. 4000266, for example, image data that is subjected to a halftone process such as dithering at 1 bit/pixel is used as input data and period detection is performed in units of one line using the fact that image data having been subjected to the dithering originally has periodicity, to determine the number of words in the dictionary. However, because a white image in which nothing is written (which occupies a large area in a printer image) basically has no periodicity, no period can be determined.
In the data coding method described in Japanese Patent No. 4000266, matches with words in the dictionary are counted with each of plural periods and a period with which the count value is the largest is used. However, in the case of a white image in which nothing is written, the image has no periodicity and thus a match counter for the shortest period is likely to have the largest value.
In a printer image, because different dithering patterns (dithering patterns having different sizes) are used for different attributes (such as the character, the photograph, and the graphic), it is difficult to determine a period in a line in which the character, the photograph, and the like exist together (FIG. 28 is an example in which a photographic image, a character image, and a graphic image exist together in one line) and thus the count value of a match counter for the shortest period is likely to be largest as in the case of a white image in which nothing is written. In this case, the period having the smallest value is selected and the speed of the compression device is decreased because the compression is performed using the dictionary in units of the period.
In view of the above, there is a need to code data with as long a period as possible among periods with which input data and dictionary data matches the most, thereby further increasing the coding rate.